<template>
	<view>
		<Header :isBack="true">
			<block slot="content">{{title}}</block>
		</Header>
		<!-- 快捷方式 -->
		<view class="cate-section">
			<view class="cate-section-content">
				<image class="cate-item-img" mode="aspectFit" :src="src"></image>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapState
	} from 'vuex';
	export default {

		data() {
			return {
				title: '',
				type: 1,
				src: ''
			};
		},

		//下拉刷新
		onPullDownRefresh() {
			//判断是否登录
			let result = this.$api.isLogin();
			if (result === false) {
				return false;
			}
			this.loadData();
			// 停止下拉刷新
			setTimeout(function() {
				uni.stopPullDownRefresh()
			}, 500)

		},
		onLoad(option) {
			//判断是否登录
			let result = this.$api.isLogin();
			if (result === false) {
				return false;
			}
			this.type = option.type;
			this.loadData();
		},
		methods: {
			async loadData() {
				let type = this.type;
				if (type == 1) {
					this.title = '营业执照'
					this.src = 'https://liande.oss-cn-beijing.aliyuncs.com/pictures/yingyezhizhao.png';
				} else {
					this.title = '人力资源许可证'
					this.src = 'https://liande.oss-cn-beijing.aliyuncs.com/pictures/renliziyuan.png';
				}
			},
		},
	}
</script>

<style>
	page {
		background-color: #f7f7f7;
		font-size: $font-base;
	}
</style>

<style lang="scss" scoped>
	/* 快捷方式 */
	.cate-section {
		// #ifdef APP-PLUS
		padding-top: 160rpx;
		// #endif

		// #ifdef H5
		padding-top: 110rpx;
		// #endif

		// #ifdef MP-WEIXIN
		padding-top: 160rpx;
		// #endif
		background: #fff;

		.cate-section-content {

			flex-wrap: wrap;
			border-top: 1px solid #ececec;
			border-bottom: 1px solid #ececec;
			
			display: flex;
			align-items: center;
			justify-content: center;
		}
	}
</style>